<template>
  <div>
    <h1>积分商城</h1>
    <table>
      <tr><td>商品名称</td><td>价格</td><td>库存</td><td>操作</td></tr>
      <tr v-for="i in data" :key="i"><td>{{i.name}}</td><td>{{i.price}}</td><td>{{i.num}}</td><td>购买</td></tr>
    </table>
  </div>

</template>

<script>
import axios from 'axios';
export default {
  name: "xiaoshangcheng"
  ,
  data() {
    return {
      data:'',
    }
  },
  methods: {
    getdata(){
      axios({url:' http://127.0.0.1:5000/getshangpin',method:'get'}).then(res=>{
        console.log(res)
        this.data=res.data.list
      })
    }
  },
  mounted() {
    this.getdata()

  }
}
</script>

<style scoped>

</style>